<html>
<head>
<style>
:visited { color: red }
:visited #l1 { color: green }
:visited > #l2 { color: green }
:visited span :visited { color: green }
:link + #span1 { color: green }
:visited + #span1 { color: red }
:link ~ #span2 { color: green }
:visited ~ #span2 { color: red }
</style>
</head>
<body>
<p>
Test that visited style matches to the topmost link in a descendant selector.
The link should be green, with red underlining.
</p>
<p>
<a href=""><span id="l1">Link</span></a>
</p>
<p>
Test that visited style matches to the topmost link in a child selector.
The link should be green, with red underlining.
</p>
<p>
<a href=""><span id="l2">Link</span></a>
</p>
<p>
Test that visited style does not match to non-topmost links.
The link should be red, with red underlining.
</p>
<p>
<a href=""><span><a href="" id="l3">Link</a></span></a>
</p>
<p>
Test that direct adjacent selector doesn't match visited style.
The link should be red, with red underlining.
The span should be green.
</p>
<p>
<a href="">Link</a>
<span id=span1>Span</span>
</p>
<p>
Test that indirect adjacent selector doesn't match visited style.
The link should be red, with red underlining.
The span should be green.
</p>
<p>
<a href="">Link</a>
<span id=span2>Span</span>
</p>
</body>
</html>
